public class RecursionExercise01 {
    public static void main(String[] args) {
        BB bb = new BB();
        int n = 7;
        System.out.println(n +  "对应的斐波那契数是：" + bb.test(n));
    }
}
class BB{
    public int test(int n) {
        if (n >= 1) {
            if (n == 1 || n == 2) {
                return 1;
            } else {
                return test(n - 1) + test(n - 2);
            }
        } else {
            System.out.println("输入数据有误！");
            return -1;
        }
    }
}
